<template>
  <el-form ref="form" :model="form" label-width="180px"   label-position="right">
  <el-form-item label="产品名称" >  
    <el-select v-model="form.PRODUCE_WNAME" placeholder="产品名称">
                                        <el-option label="青铜安心计划" value="青铜安心计划"></el-option>
                                        <el-option label="青铜周详计划" value="青铜周详计划"></el-option>
                                        <el-option label="青铜畅游计划" value="青铜畅游计划"></el-option>
                                        <el-option label="白银安心计划" value="白银安心计划"></el-option>
                                        <el-option label="白银周详计划" value="白银周详计划"></el-option>
                                        <el-option label="白银畅游计划" value="白银畅游计划"></el-option>

                                        <el-option label="黄金安心计划" value="黄金安心计划"></el-option>
                                        <el-option label="黄金周详计划" value="黄金周详计划"></el-option>

                                        <el-option label="黄金畅游计划" value="黄金畅游计划"></el-option>
                                        <el-option label="铂金安心计划" value="铂金安心计划"></el-option>

                                        <el-option label="铂金周详计划" value="铂金周详计划"></el-option>
                                        <el-option label="铂金畅游计划" value="铂金畅游计划"></el-option>
    </el-select>
  </el-form-item>
   <el-form-item label="内部名称">
    <el-input v-model="form.PRODUCE_INAME"></el-input>
  </el-form-item>
    <el-form-item style="text-align:center">
  <el-button type="primary" @click="submit" >
      提交
  </el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import api from "@/js/api";
import getid from "@/js/getid";
export default {
  data() {
    return {
      form: {
        PRODUCE_ID: "",
        PRODUCE_WNAME: "",
        PRODUCE_INAME: ""
      }      
    };
  },
  props: {
    type: {
      type: String,
      default: ""
    },
    Id: {
      type: String,
      default: ""
    }
  },
  methods: {
    submit() {
      let that = this;
      if (this.type == "新增") {
        this.form.PRODUCE_ID = getid.getid();
        api.PRODUCEAdd(that, this.form);
      } else {
        api.PRODUCEUpdate(that, this.form);
      }
    }
  },
  created() {
    if (this.type == "查看") {
      let that = this;
      var data = {
        Id: this.Id
      };
      api.PRODUCEGetOne(that, data, function(msg) {
        that.form = msg.Result;
      });
    }
  }
};
</script>

<style>

</style>
